-
Notifications
You must be signed in to change notification settings - Fork 16
2 fingers pinch gestures and thresholds for gestures #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Basic implementation enables one shot pinch gesture. That is the command from config file will run only once as soon as fingers move 50% from the initial fingers position. - Added a configurable distance variable to pinch gesture. I felt that pinch gesture is kinda tricky to execute on touchpad, so I changed a way of calculation when to trigger the command and added the distance for fingers travel to configuration. Basically a `0.5` distance feels quite ok to me, but it becomes really snappy at `0.1`.
Pinch Gesture
* Reorganized code a little bit
- Previously swipe gesture was triggered only when fingers leaving
touchpad thus threshold was useless. Moved trigger function outside
of event handling.
- Created reset functions for gestures to reset struct holding event
data to default values.
* Added swipe threshold.
- Added new config keys
* `settings.pinch.distance` - now instead of
`pinch.commands.distance` holds the value required for fingers to
travel before executing pinch gesture.
* `settings.swipe.threshold` - new key to set how long should be
swipe to execute command.
This commit introduces breaking changes due to changes in config file
format. Hopefully that's the last time.
* Config keys changed format, see readme for examples.
* Both swipe and pinch gestures now have `settings.threshold` key which can be
values 0.0 - 1.0.
Defaults:
Swipe: 1.0
Pinch: 0.25
* Both swipe and pinch now have `settings.one_shot` which, if set,
allows only one execution of command per gesture.
Defaults:
Swipe: true
Pinch: false
* Swipe gesture now has `settings.trigger_on_release` defaulting to
false. If set to true the command for swipe will be triggered when
fingers are moved from touchpad UNLESS it is also one_shot gesture and
gesture was already triggered.
Removed fork info
|
Can you elaborate on what you mean with continuous pinch and swipe gestures? |
|
one time gesture is getting triggered once as soon as the swipe or pinch threshold is reached. For example pinch in gesture executing |
|
@osleg wanna merge this back into this repo? :) |
|
Sure, do you want the entire fork? |
|
That'd be great, if you want I could add you as collaborator to this repo? :) |
|
@osleg ? |
|
@Coffee2CodeNL sorry took me some time ^_^ |
This commit introduces breaking changes due to changes in config file
format.
Added swipe threshold.
Added a configurable treshold variable to pinch gesture.
I felt that pinch gesture is kinda tricky to execute on touchpad,
so I changed a way of calculation when to trigger the command and
added the distance for fingers travel to configuration.
Basically a
0.5distance feels quite ok to me, but it becomes reallysnappy at
0.1.Reorganized code a little bit
touchpad thus threshold was useless. Moved trigger function outside
of event handling.
data to default values.
Config keys changed format, see readme for examples.
Both swipe and pinch gestures now have
settings.thresholdkey which can bevalues 0.0 - 1.0.
Defaults:
Swipe: 1.0
Pinch: 0.25
Both swipe and pinch now have
settings.one_shotwhich, if set,allows only one execution of command per gesture.
Defaults:
Swipe: true
Pinch: false
Swipe gesture now has
settings.trigger_on_releasedefaulting tofalse. If set to true the command for swipe will be triggered when
fingers are moved from touchpad UNLESS it is also one_shot gesture and
gesture was already triggered.